LEX 'CURLEX' TITLE CursorLex 1985/03/16 John R Baker 618 ID #5E MSG 0 POLL POLHND ENDTXT {no keywords} pKYDF EQU #0001B {the key definition poll} f1USER EQU #FFFF7 {user mode flag} SFLAG? EQU #1364C {routine to test system flags} gLEFT EQU #0009F {key number for g< key} gRIGHT EQU #000A0 {key number for g> key} CSLC3 EQU #1B43B {C shift left 3 nibs} CSLC5 EQU #1B435 {C shift left 5 nibs} ESCSEQ EQU #023C1 {sends escape sequences to the display} CSRC5 EQU #1B41B {C shift right 5 nibs} POLHND LC(2) pKYDF ?B=C B {is this key definition poll?} GOYES tstkey {yes} RTNSXM {no, return} tstkey C=D A {save D(A)} R3=C {in R3} LC(2) f1USER GOSBVL SFLAG? {is user mode on?} GOC key01 {yes} C=R3 {no} D=C A {restore D(A)} RTNSXM {return} key01 C=R3 D=C A {restore D(A)} C=R0 {get current key} GOSBVL CSRC5 {put in C(A)} A=C A {put in A(A)} LC(2) gLEFT ?A=C B {is it g< ?} GOYES left {yes} LC(2) gRIGHT ?A=C B {is it g> ?} GOYES right {yes} RTNSXM {return, not a key we recognize} left LC(2) #44 {value for escape sequence} GOTO key02 right LC(2) #43 {value for escape sequence} key02 A=0 W {we need M field clear for counter} A=C B {load escape value in A(B)} C=0 W LC(2) #14 {counter for 21 shifts (count-1)} GOSBVL CSLC3 {put into M field} A=C M {put counter into A(M)} R3=A {store escape char & counter in R3} C=RSTK {save 3 return stack levels} GOSBVL CSLC5 {only 2 available} C=RSTK {and we need 5} GOSBVL CSLC5 {ESCSEQ needs 4 & we ned 1 to call} C=RSTK R0=C {save stack levels in R0} loop C=R3 {put escape char in C(B)} GOSBVL ESCSEQ {send to display: LCD & HPIL} C=R3 {get counter} C=C-1 M {decrement counter} GOC key03 {exit if done} R3=C {else store new counter} GONC loop {BET} key03 C=R0 {restore return stack} RSTK=C GOSBVL CSRC5 RSTK=C GOSBVL CSRC5 RSTK=C ST=0 0 {say we're not returning a value} XM=0 {indicate poll handled} RTN {return to character editor} END